package com.code;

public class DogTest {

	public static void main(String[] args) {
		//测试喂狗案例，屏蔽子类差异性
		TuDog tuDog = new TuDog();
		Husky husky = new Husky();
		Teddy teddy = new Teddy();
		Person person = new Person();
		
		//调用喂狗方法
		person.feedDog(tuDog);//传入的是tuDog
		person.feedDog(husky);//传入的是husky
		person.feedDog(teddy);//传入的是teddy
	}

}
